package javaCode;

/**
 * Created by lxy_920912 on 04/05/2017.
 */
public class LeetCode104 {
    public int maxDepth(TreeNode root) {
        if(root == null){
            return  0;
        }
        if(root.left == null && root.right == null){
            return  1;
        }
        return Math.max(maxDepth(root.left)+1,maxDepth(root.right)+1);

    }

}
